<?php
/**
* Simple example script using PHPMailer with exceptions enabled
* @package phpmailer
* @version $Id$
*/header("content-type:text/html;charset=utf-8"); 
ini_set("magic_quotes_runtime",0); 
require '../class.phpmailer.php';

try {
	$mail = new PHPMailer(true); 
	$mail->IsSMTP();
	$mail->CharSet='UTF-8'; //设置邮件的字符编码，这很重要，不然中文乱码
	$mail->SMTPAuth   = true;                  //开启认证
	$mail->Port       = 25;                    
	$mail->Host       = "smtp.qq.com"; 
	$mail->Username   = "357969524@qq.com";    //注意要开通STMP协议，例如在	qq邮箱账号设置那可以设置
	$mail->Password   = "5360917";   //邮箱密码         
	//$mail->IsSendmail(); //如果没有sendmail组件就注释掉，否则出现“Could  not execute: /var/qmail/bin/sendmail ”的错误提示
	$mail->AddReplyTo("357969524@qq.com","mckee");//回复地址
	$mail->From       = "357969524@qq.com";
	$mail->FromName   = "www.phpddt.com";
	$to = "1079768887@qq.com";//接收邮件的账号
	$mail->AddAddress($to);
	$mail->Subject  = "91测试";//邮件标题
	$mail->Body = "<h1>广州美声</h1>这是广州美声（<font color=red>www.meisheng.com</font>）对广州美声的测试内容";//邮件内容
	$mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; //当邮件不支持html时备用显示，可以省略
	$mail->WordWrap   = 80; // 设置每行字符串的长度
	$mail->AddAttachment("f:/test.jpg");  //可以添加附件，绝对路径
	$mail->IsHTML(true); 
	$mail->Send();
	echo '邮件已发送';
} catch (phpmailerException $e) {
	echo "邮件发送失败：".$e->errorMessage();
}
?>